﻿using RBAC.Repository.RabbitInterfae;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using Traceability.Domain;
using Traceability.Service.Interfae;

namespace Traceability.Service.Impl
{
    public class ProcessdService : IProcessdService
    {
        private readonly IProcessdRepository _processdRepository;
        public ProcessdService(IProcessdRepository processdRepository)
        {
            _processdRepository = processdRepository;
        }
        /// <summary>
        /// 添加深加工信息
        /// </summary>
        /// <param name="processd"></param>
        /// <returns></returns>
        public async Task<int> AddProcess(Processd processd)
        {
           return await _processdRepository.AddAsync(processd);
        }

        
        /// <summary>
        /// 显示深加工信息
        /// </summary>
        /// <param name="bacth"></param>
        /// <returns></returns>
        public async Task<List<Processd>> GetProcessdsList(int pid)
        {
            return await _processdRepository.GetAsync(d => d.TraceabilityId==pid);
        }
        /// <summary>
        /// 修改深加工信息
        /// </summary>
        /// <param name="processd"></param>
        /// <returns></returns>
        public async Task<int> UpdateProcced(Processd processd)
        {
           return await _processdRepository.UpdateAsync(processd);
        }
    }
}
